import React, {Component} from 'react'

class ClassState extends Component{
    constructor(){
        //1. 调用父类的构造器
        super();
        //2. 定义状态数据
        this.state = {
            count:100,
            msg:'atguigu'
        }
    }
    render(){
        console.log('this.state: ',this.state);
        let {count, msg} = this.state;// 先解构在使用
        return (
            <div>
                <h3>Class 类组件 的状态数据的读取</h3>
                <p>count: {this.state.count} - {count}</p>
                <p>msg: {this.state.msg} - {msg}</p>
            </div>
        )
    }
}

export default ClassState;